package lapsnake.model.expr;

import lapsnake.model.*;
import lapsnake.model.data.*;
import lapsnake.py.ast.ASTHelperFactory; import java.beans.PropertyVetoException;

import org.python.antlr.ast.*;

/**Wrapper class with helper functions for BinOp nodes*/
public class LapBinOp extends LapExpression {
	public final SingleChild<LapExpression> left = new SingleChild<>(this, LapExpression.class); 
	public final VetoableProperty<operatorType> op = new VetoableProperty<>(operatorType.class);
	public final SingleChild<LapExpression> right = new SingleChild<>(this, LapExpression.class); 
	
	
	public LapBinOp(PyAST pyAST, ChildField<? super LapBinOp> parent, BinOp node) throws PropertyVetoException {
		super(pyAST, parent, node);
		
		ASTHelperFactory.makeHelper(pyAST, left, node.getInternalLeft());
		op.setInternal(node.getInternalOp());
		ASTHelperFactory.makeHelper(pyAST, right, node.getInternalRight());
		
		buildTextNodes(node);
	}
}
